package eco.lamp.bl;

import android.os.Parcel;
import android.os.Parcelable;

public class LampUpgradeItem implements Parcelable{
	public LampItem mLampOld;
	public LampItem mLampNew;
	
	public LampUpgradeItem(LampItem lampOld, LampItem lampNew) {
		mLampOld = lampOld;
		mLampNew = lampNew;
	}
	
	public LampUpgradeItem(Parcel in) {
		mLampOld = in.readParcelable(LampItem.class.getClassLoader());
		mLampNew = in.readParcelable(LampItem.class.getClassLoader());
	}
	
	@Override
	public String toString() {
		return String.format("%s to %s", mLampOld, mLampNew);		
	}

	public int describeContents() {
		return 0;
	}

	public void writeToParcel(Parcel dest, int flags) {
		dest.writeParcelable(mLampOld, flags);
		dest.writeParcelable(mLampNew, flags);
	}
	
	   public static final Parcelable.Creator<LampUpgradeItem> CREATOR = new Parcelable.Creator<LampUpgradeItem>() {
			public LampUpgradeItem createFromParcel(Parcel in) {
				return new LampUpgradeItem(in);
			}

			public LampUpgradeItem[] newArray(int size) {
				return new LampUpgradeItem[size];
			}
		};
}
